//
//  AppDelegate.swift
//  creativeassistant
//
//  Created by 灵工邦 on 2025/1/22.
//

import UIKit
import IQKeyboardManagerSwift

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    
    var window: UIWindow?
    var launchManager: LaunchManager?
    var isForceLandscape: Bool = false
    
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        configurationRootViewController()
        configurationKeyboard()
        return true
    }
    
    func configurationRootViewController() {
        window = UIWindow.init(frame: UIScreen.main.bounds)
        window?.backgroundColor = .white
        let tabVC = ZSBaseTabBarController()
        window?.rootViewController = tabVC
        window?.makeKeyAndVisible()
        launchManager = LaunchManager()
    }
    
    func configurationKeyboard() {
        IQKeyboardManager.shared.enable = true
        IQKeyboardManager.shared.shouldResignOnTouchOutside = true
    }
    
    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        if isForceLandscape {
            return .landscapeRight
        }
        return .portrait
    }
}

